<?php
/**
 * Yii view view
 *
 * @author nguyenmanhluu
 * @since Aug 27, 2013 - 12:05:55 AM
 */
?>
<div class="row-fluid">

    <div class="box span12">
        <div class="box-header">
            <h2>
                <i class="icon-user"></i>
                <?php echo $user->name ?>
            </h2>
        </div>
        <div class="box-content">            
            <div class="row-fluid">
                <div class="span6">

                </div>
            </div>
            <div class="row-fluid">
                <div class="span2">
                    <?php
                    $photo = (isset($customer)) ? $this->customerModel->publicPhoto : $user->publicPhoto;
                    ?>
                    <img src="<?php echo $photo ?>" alt="<?php echo $user->name ?>"/>                    
                </div>
                <div class="span6">
                    <table class="table table-striped">
                        <tbody>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('name') ?></td>
                                <td><?php echo $user->name ?></td>
                            </tr>
                            <?php if ($user->type != Users::TYPE_BUSINESS): ?>
                                <tr>
                                    <td><?php echo $user->getAttributeLabel('firstname') ?></td>
                                    <td><?php echo $user->firstname ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo $user->getAttributeLabel('lastname') ?></td>
                                    <td><?php echo $user->lastname ?></td>
                                </tr>
                            <?php endif; ?>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('status') ?></td>
                                <td><?php echo $user->status ?></td>
                            </tr>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('email') ?></td>
                                <td><?php echo $user->email ?></td>
                            </tr>
                            <tr><td><?php echo $user->getAttributeLabel('birthday') ?></td>
                                <td>
                                    <?php echo (!empty($user->birthday) && $user->birthday > 0) ? date('d/M/Y', $user->birthday) : 'N/A' ?>
                                </td>
                            </tr>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('home_phone') ?></td>
                                <td><?php echo $user->home_phone ?></td>
                            </tr>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('mobile_phone') ?></td>
                                <td><?php echo $user->mobile_phone ?></td>
                            </tr>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('office_phone') ?></td>
                                <td><?php echo $user->office_phone ?></td>
                            </tr>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('address') ?></td>
                                <td><?php echo $user->address ?></td>
                            </tr>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('city') ?></td>
                                <td><?php echo $user->city ?></td>
                            </tr>
                            <tr>
                                <td><?php echo $user->getAttributeLabel('country') ?></td>
                                <td><?php echo $user->country ?></td>
                            </tr>
<!--                            <tr>
                                <td><?php // echo $user->getAttributeLabel('note')          ?></td>
                                <td><?php // echo $user->note          ?></td>
                            </tr>-->
                        </tbody>
                    </table>                    
                    <a href="<?php echo Yii::app()->createUrl('appointment/index') ?>" class="btn btn-success btn-large">
                        <i class="icon-book"></i> Book Appointment                                            
                    </a>
                    <div class="clearfix"></div><br>
                </div>
            </div>
            <div class="clearfix"></div>
            <?php if ($user->type == Users::TYPE_CUSTOMER): ?>
                <?php
                $this->renderPartial('//customer/_recent_appt');
                ?>
            <?php endif; ?>

            <?php if ($user->type == Users::TYPE_STAFF): ?>
                <?php
                $this->renderPartial('//user/staff/_services', array(
                    'service_staff' => $service_staff
                ));
                ?>
                <?php
                $this->renderPartial('//user/staff/_recent_appt');
                ?>
            <?php endif; ?>
        </div>
    </div><!--/span-->
</div>

